package com.lxhotel.agentmcp.tool;

import com.lxhotel.agentmcp.entity.Hotel;
import com.lxhotel.agentmcp.mapper.HotelMapper;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class HotelTool {

    @Autowired
    private HotelMapper hotelMapper;

    @Tool(description = "根据经纬度获取最近的酒店")
    public Hotel getHotelByLongitudeAndLatitude(@ToolParam(description = "高德经度") String amapLongitude, @ToolParam(description = "高德纬度") String amapLatitude) {
        return hotelMapper.getHotelByAmaqLongitudeAndLatitude(amapLongitude, amapLatitude);
    }

    @Tool(description = "获取酒店列表")
    public List<Hotel> getAllHotel() {
        return hotelMapper.selectAll();
    }

    @Tool(description = "根据酒店名称获取匹配到的多个酒店信息")
    public List<Hotel> selectByHotelNameLike(@ToolParam(description = "酒店名称") String name) {
        return hotelMapper.selectByHotelNameLike(name);
    }

    @Tool(description = "根据酒店名称获取酒店信息")
    public Hotel selectByHotelName(@ToolParam(description = "酒店名称") String name) {
        return hotelMapper.selectByHotelName(name);
    }


}
